<?php

include_once 'Expression.php';

/**
 * Represents a reference to a function.
 * 
 * @package UC_PHPCodeModel
 * @author Uros Calakovic
  */

class FunctionReferenceExpression extends Expression
{
    public function __construct($FunctionName)
    {
        parent::__construct();
        
        $this->set_FunctionName($FunctionName);
    }
    
    public function __set($name, $value)
    {
        parent::__set($name, $value);
        
        if($name == 'FunctionName')
        {
            $this->set_FunctionName($value);
        }
    }

    public function __get($name)
    {
        $ret = parent::__get($name);
        
        if($ret != null)
        {
            return $ret;
        }
        
        if($name == 'FunctionName')
        {
            return $this->get_FunctionName();
        }
    }
    
    public function get_FunctionName()
    {
        return $this->FunctionName;
    }
    
    public function set_FunctionName($FunctionName)
    {
        if(is_string($FunctionName))
        {
            $this->FunctionName = $FunctionName;
        }
        else
        {
            throw new InvalidArgumentException(
                'The function name must be a string.');
        }
    }
    
    private $FunctionName;

}

?>
